//防抖函数
const debounce = (func, delay = 500) => {
    if (window.timer) {
        clearTimeout(window.timer)
    }
    window.timer = setTimeout(() => {
        func()
    }, delay)
}

export default debounce